﻿package org.kisekiproject.ui {	import flash.display.Sprite;	import flash.events.Event;	import flash.text.TextField;		/**	 * Error dialog.	 */	public class ErrorDialog extends Sprite {		private var _messageField:TextField;		private var _error:Error;		/**		 * Constructor.		 */		public function ErrorDialog(error:Error) {			_error=error;			addEventListener(Event.ADDED_TO_STAGE,onAddedToStage);		}		/**		 * On added to stage.		 */		private function onAddedToStage(e:Event):void {			graphics.beginFill(0xff8080);			graphics.drawRect(0,0,stage.stageWidth,stage.stageHeight);			graphics.endFill();			_messageField=new TextField();			_messageField.x=20;			_messageField.y=20;			_messageField.width=stage.stageWidth-40;			_messageField.height=stage.stageHeight-40;			_messageField.text="**** FATAL ERROR ***\n\n"+_error.getStackTrace();			addChild(_messageField);		}	}}